<?php
/**
 * Created By PhpStorm
 * Author: patrick wu
 * Date: 2021/1/7
 * Time: 10:10
 */
namespace App\Http\Model\Mysql;

use Illuminate\Database\Eloquent\Model;

class ProductIntegralModel extends Model
{
    const IS_VIP    =   1,
        NOT_VIP     =   0;

    const IS_SHELF  =   1,
        NOT_SHELF   =   0;

    protected $table    =   'mini_product_integral';

    protected $guarded  =   [];

    protected $dateFormat   =   'U';

    /**
     * 定义连接商品表
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function good()
    {
        return $this->hasOne(ProductModel::class, 'id', 'good_id');
    }

    /**
     * 定义连接规格表
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function spec()
    {
        return $this->hasOne(ProductSpecsModel::class, 'id', 'spec_id');
    }
}
